package com.woniuxy.entity;


import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;

@Data
@NoArgsConstructor
public class ResponseResult<T> {
    private int code;
    private String msg;
    private T data;

    public ResponseResult(int code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public ResponseResult(T data) {
        this(200, "ok", data);
    }

    public ResponseResult(int code, String msg) {
        this(code, msg, null);
    }

    public static final ResponseResult<Void> SUCCESS = new ResponseResult(200, "ok");
    public static final ResponseResult<Void> FAIL = new ResponseResult(500, "fail");
}
